import { addCollection } from '@iconify/vue';

import ep from '@iconify-json/ep/icons.json';
import antDesign from '@iconify-json/ant-design/icons.json';
import iconPark from '@iconify-json/icon-park/icons.json';
import iconParkOutLine from '@iconify-json/icon-park-outline/icons.json';
import iconParkSolid from '@iconify-json/icon-park-solid/icons.json';

export const icons = {
  'Ant Design': antDesign,
  'Element Plus': ep,
  'Icon Park': iconPark,
  'Icon Park Outline': iconParkOutLine,
  'Icon Park Solid': iconParkSolid
} as const;

export type DefaultIconsType =
  | `ep:${keyof typeof ep.icons}`
  | `ant-design:${keyof typeof antDesign.icons}`
  | `icon-park-outline:${keyof typeof iconParkOutLine.icons}`
  | `icon-park-solid:${keyof typeof iconParkSolid.icons}`
  | `icon-park:${keyof typeof iconPark.icons}`;

export const setupIcons = () => {
  Object.values(icons).forEach(item => addCollection(item));
};
